<!-- navbar-static-top creates a full width top navbar which scrolls away -->
<nav id="header" class="navbar navbar-inverse navbar-static-top">
    <div class="navbar-inner">
        <a href="{% url 'engonline.views.home' %}" class="brand">EngOnline</a>
        <div class="container">
            <!-- Site menu -->
            <ul class="nav pull-left">
                {% if user.is_authenticated %}
                    {% include "nav.logout.html" %}
                {% else %}
                    {% include "nav.login.html" %}
                {% endif %}
            </ul>
            <!-- User menu -->
            {% if user.is_authenticated %}
            <div class="user-box pull-right">
                <ul class="nav">
                {% if user.is_staff %}

                    <li class="dropdown">
                        <a href="." class="dropdown-toggle" data-toggle="dropdown">
                            Viewing Site as 
                            {% if request.session.viewing_as_student %}
                                Student
                            {% else %}
                                Admin
                            {% endif%}
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu pull-right">
                            <li><a id="view-as-admin" href=".">Administrator</a></li>
                            <li><a id="view-as-student" href=".">Student</a></li>
                        </ul>
                    </li>

                {% endif %}
                
                    <li class="divider-vertical"></li>
                    <li class="dropdown">
                        <a href="." class="dropdown-toggle" data-toggle="dropdown">
                            Welcome {{ user.first_name }}
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu pull-right">
                            <li><a href="{% url 'auth.views.view_user' username=user.username %}"><i class="icon-user"></i> My Profile</a></li>
                            <li><a href="{% url 'auth.views.logout' %}"><i class="icon-exclamation-sign"></i> Log Out</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            {% endif %}
        </div>
    </div>
</nav>